import App from './App'
import uviewPlus from '@/uni_modules/uview-plus'
import { setBaseURL } from '@/utils/request.js'
import * as request from './utils/request.js'


// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
// 挂载全局 request
Vue.prototype.$request = request
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  // main.js，注意要在use方法之后执行
  app.use(uviewPlus)
  // ⚡ 插件挂载完成后再设置 baseURL
  setBaseURL()
  app.config.globalProperties.$request = request
 
  // import('./utils/request')
  return {
    app
  }
}
// #endif